'use strict';
/**
 * wechat strategy
 * https://github.com/liangyali/passport-wechat
 */


var passport = require('passport'),
    WechatStrategy = require('passport-wechat').Strategy,
    config = require('../config');
    //users = require('../../app/controllers/users.server.controller');

module.exports = function() {
    passport.use(new WechatStrategy({
        appid: config.strategies.wechat.appId, // 'wx0ff7006738630a6c',
        appsecret: config.strategies.wechat.appSecret, //'866796103d71f653d69809cf1e8c2dae',
        callbackURL: config.strategies.wechat.callbackUrl, //'http://192.168.1.70:3000/auth/wechat/callback',
        scope: config.strategies.wechat.scope, //'snsapi_base',
        state: config.strategies.wechat.state //true
        // appid: 'wx3af1ba5b6113419d',
        // appsecret: '74c7bf3702ff7d2cbc554ce19248a4b7',
        // callbackURL: 'http://api.liangyali.com:3000/auth/wechat/callback'
    }, function (openid, profile, token, done) {
        return done(null, openid, profile);
    }));

};
